home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / SOM / OpenDoc and SOM / IDL / Frame.idl < prev    next >
Encoding:
Text File  |  1994-04-19  |  7.4 KB  |  288 lines  |  [TEXT/MPS ]

  1. //# Copyright:    © 1993-94 by Apple Computer, Inc., all rights reserved.
  2. #ifndef _FRAME_
  3. #define _FRAME_
  4.  
  5. #ifndef _PSTOBJ_
  6. #include "PstObj.idl"
  7. #endif
  8.  
  9. //==============================================================================
  10. // Theory of Operation
  11. //==============================================================================
  12. /*
  13. If an XMPPart’s contents needs to become visible, it provides to the embedding
  14. XMPPart an XMPFrame with a desired frameShape and an XMPCanvas,  in which’
  15. coordinate space the frameShape is defined, and an XMPWindow, in which
  16. eventually the XMPPart’s contents will be rendered.
  17.  
  18. The embedding XMPPart’s Part Handler then reshapes the XMPFrame’s bounding
  19. FrameShape and also sets the ClipShape to be used for clipping drawings or
  20. cached images rendered within the XMPFrame.  It also decides about proper
  21. alignment within its own space and, therefore, sets the XMPFrame’s External
  22. Transform (c.f. below) accordingly.
  23.  
  24. The Part Handler having created an XMPFrame object adds it to the XMPWindow’s
  25. list of visible XMPFrames.
  26.  
  27. Invalidation concerns two cases:  an XMPFrame’s XMPTransfom or a (partial) area
  28. of the XMPFrame can be affected as described below.
  29.  
  30. First, an XMPFrame’s position and shape within its containing Root XMPFrame
  31. (which is equal to the XMPWindow’s frame) is determined by its Aggregate
  32. Transfoms, which consists of the Frame’s External and Internal Transform
  33. pre-composed with the containing Frame’s Aggregate Transforms.  For
  34. mapping a point given in Window coordinates to a frame’s local space, XMPFrame
  35. transforms it by using its Aggregate Internal Transform. Similarly, for
  36. representing an XMPShape object, given in a containing Frame’s coordinate
  37. space, into this Frame’s coordinate space, the given shape becomes transformed
  38. by applying this Frame’s External Transform. For this release, it is required
  39. that the local coordinate spaces have the same metric as the Root Frame’s
  40. canvas. In other words, the Frames’ associated XMPCanvas objects must have the
  41. same type as the Root Frame’s XMPCanvas object.  Independently, a part handler
  42. can come up with its own private canvases and mappings to the XMPCanvas object
  43. given to its XMPFrame object.
  44.  
  45. Whenever a Part Handler for a containing XMPPart changes a contained XMPFrame’s
  46. External Transform (e.g. moving the XMPFrame to a new position) or the
  47. XMPFrame’s own Part Handler changes the Internal Transform (e.g. scrolling the
  48. visible XMPPart  contents within the XMPFrame), the XMPFrame’s Aggregate
  49. Transforms are invalidated or get updated.
  50.  
  51. Furthermore, to assist a containing Part Handler in finding a fine-tuned
  52. layout between adjacent contained Frames, the UsedShape, set by its Part, may
  53. be used by the embedding Part.  It describes the XMPShape of an XMPFrame which
  54. is used by its actual contents, versus the FrameShape, that reflects rather the
  55. required XMPShape as defined by the contained Part Handler.
  56.  
  57. ActiveShape, also set by this XMPFrame’s XMPPart’s Part Hanlder, defines the
  58. area within the UsedShape which reacts to mouse clicks which it receives when
  59. the Frame is not set to Frozen.
  60.  
  61. All Shapes are given in their Frame’s local coordinate space.
  62. */
  63.  
  64.  
  65. //==============================================================================
  66. // Types
  67. //==============================================================================
  68.  
  69. //==============================================================================
  70. // Classes defined in this interface
  71. //==============================================================================
  72.  
  73. interface  ODFrame;
  74.  
  75. //==============================================================================
  76. // Classes used by this interface
  77. //==============================================================================
  78.  
  79. interface  ODFrameFacetIterator;
  80.  
  81. interface  ODCanvas;
  82. interface  ODDraft;
  83. interface  ODFacet;
  84. interface  ODPart;
  85. interface  ODShape;
  86. interface  ODStorageUnit;
  87. interface  ODTransform;
  88. interface  ODDragItemIterator;
  89. interface  ODWindow;
  90.  
  91.  
  92. //# $$$$$ struct ODPoint;
  93.  
  94. //==============================================================================
  95. // ODFrame
  96. //==============================================================================
  97.  
  98. interface ODFrame :  ODPersistentObject
  99. {
  100.  
  101. // getters/setters:
  102.  
  103.     ODFrame GetContainingFrame();
  104.     
  105.     void SetContainingFrame(in ODFrame frame);
  106.  
  107.     ODULong GetFrameGroup();
  108.     
  109.     void SetFrameGroup(in ODULong groupID);
  110.  
  111.     ODBoolean IsRoot();
  112.  
  113.     ODBoolean IsSubframe();
  114.     
  115.     void SetSubframe(in ODBoolean isSubframe);
  116.  
  117.     ODBoolean IsOverlaid();
  118.  
  119.     ODBoolean IsFrozen();
  120.     
  121.     void SetFrozen(in ODBoolean isFrozen);
  122.  
  123.     ODBoolean DoesPropagateEvents();
  124.     
  125.     void SetPropagateEvents(in ODBoolean doesPropagateEvents);
  126.  
  127. //# part
  128.  
  129.     ODPart  GetPart();
  130.  
  131.     void ChangePart(in ODPart part);
  132.  
  133.     ODInfoType  GetPartInfo();
  134.     
  135.     void SetPartInfo(in ODInfoType partInfo);
  136.  
  137.     ODTypeToken GetViewType();
  138.     
  139.     void SetViewType(in ODTypeToken viewType);
  140.  
  141.     void ChangeViewType(in ODTypeToken viewType);
  142.  
  143.     ODTypeToken GetPresentation();
  144.     
  145.     void SetPresentation(in ODTypeToken presentation);
  146.  
  147.     void ChangePresentation(in ODTypeToken presentation);
  148.  
  149. //# facets
  150.  
  151.     void FacetAdded(in ODFacet facet);
  152.  
  153.     void FacetRemoved(in ODFacet facet);
  154.  
  155.     ODFrameFacetIterator  CreateFacetIterator();
  156.  
  157. //# shapes:
  158.  
  159.     //# frame shape
  160.     
  161.     ODShape  GetFrameShape();
  162.  
  163.     void ChangeFrameShape(in ODShape shape);
  164.  
  165.     ODShape  RequestFrameShape(in ODShape shape);
  166.  
  167.     //# used shape
  168.     
  169.     ODShape  GetUsedShape();
  170.  
  171.     void ChangeUsedShape(in ODShape shape);
  172.  
  173. //# transformations:
  174.  
  175.     ODTransform  GetInternalTransform();
  176.  
  177.     void ChangeInternalTransform(in ODTransform transform);
  178.  
  179. //# drag&drop:
  180.  
  181.    ODBoolean  IsDroppable();
  182.    
  183.    void      SetDroppable(in ODBoolean isDroppable);
  184.  
  185.    ODBoolean  IsDragging();
  186.    
  187.    void      SetDragging(in ODBoolean isDragging);
  188.  
  189. //# linking:
  190.  
  191.    void        ContentChanged(in ODChangeID change);
  192.    
  193.    void        ChangeLinkStatus(in ODLinkStatus status);
  194.    
  195.    ODLinkStatus  GetLinkStatus();
  196.  
  197. //# invalidation/draw:
  198.  
  199.    void Invalidate(in ODShape invalidShape);
  200.  
  201.    void Validate(in ODShape validShape);
  202.  
  203.    void InvalidateActiveBorder();
  204.  
  205.    void DrawActiveBorder();
  206.  
  207. //# memory management:
  208.  
  209.    ODStorageUnit   CloneTo(in ODDraftKey key,in  ODDraft destDraft);
  210.  
  211. //# ref counting
  212.  
  213.    void Close();
  214.  
  215.    void Remove();
  216.  
  217.  
  218.  
  219.  
  220. #ifdef __SOMIDL__
  221.     implementation
  222.       {
  223.     override:
  224.         somInit,
  225.         somUninit,
  226.         Purge,
  227.         Externalize,
  228.         Release;
  229.         
  230.     releaseorder:
  231.         GetContainingFrame,
  232.         SetContainingFrame,
  233.         GetFrameGroup,
  234.         SetFrameGroup,
  235.         IsRoot,
  236.         IsSubframe,
  237.         SetSubframe,
  238.         IsOverlaid,
  239.         IsFrozen,
  240.         SetFrozen,
  241.         DoesPropagateEvents,
  242.         SetPropagateEvents,
  243.         GetPart,
  244.         ChangePart,
  245.         GetPartInfo,
  246.         SetPartInfo,
  247.         GetViewType,
  248.         SetViewType,
  249.         ChangeViewType,
  250.         GetPresentation,
  251.         SetPresentation,
  252.         ChangePresentation,
  253.         FacetAdded,
  254.         FacetRemoved,
  255.         CreateFacetIterator,
  256.         GetFrameShape,
  257.         ChangeFrameShape,
  258.         RequestFrameShape,
  259.         GetUsedShape,
  260.         ChangeUsedShape,
  261.         GetInternalTransform,
  262.         ChangeInternalTransform,
  263.         IsDroppable,
  264.         SetDroppable,
  265.         IsDragging,
  266.         SetDragging,
  267.         ContentChanged,
  268.         ChangeLinkStatus,
  269.         GetLinkStatus,
  270.         Invalidate,
  271.         Validate,
  272.         InvalidateActiveBorder,
  273.         DrawActiveBorder,
  274.         CloneTo,
  275.         Close,
  276.         Remove,
  277.         GetFacets,
  278.         CommonInitFrame,
  279.         InitFrame,
  280.         InitFrameFromStorage;
  281.         
  282.  
  283.   };
  284. #endif
  285. };
  286.  
  287. #endif //# _FRAME_
  288.